#ifndef _AA_TABLE_H
#define _AA_TABLE_H

#include "../pdb_index/aa.h"

/**
   \defgroup AATable AA Tables

   \ingroup AA
*/
/** \addtogroup AATable */
/*@@{*/



/** The number of common amino acids.  (The number of amino acids that this library 'knows about'. ;)
    \ingroup AATable

 */
#define AA_COUNT 20

/** These are taken from RasMol's classification scheme for residues.
    See aa_table.c for more information.  Some classifications are
    redundant (eg acyclic and cyclic) these have been commened out,
    but left in to document the changes that were made.
    
    The remaining properties are:
    aliphatic, aromatic, cyclic, 
    large, medium, small, 
    negative, neutral, positive,
    polar, surface


  */


/**\ingroup AATable*/
enum aa_classes {
  //  AA_ACIDIC,
  //  AA_ACYCLIC,
  AA_ALIPHATIC,
  AA_AROMATIC,
  //  AA_BASIC,
  //  AA_BURIED,
  //  AA_CHARGED,
  AA_CYCLIC,
  //  AA_HYDROPHOBIC,
  AA_LARGE,
  AA_MEDIUM,
  AA_NEGATIVE,
  AA_NEUTRAL,
  AA_POLAR,
  AA_SMALL,
  AA_SURFACE,

  AA_CLASS_COUNT // THIS GOES LAST
};

/**

*/
/**\ingroup AATable*/
struct aa_entry {
           char long_abbrev[4];
           char short_abbrev;
           char classes[11];
};

/**\ingroup AATable*/
struct aa_active_site_def {
  char long_abbrev[4];
  char short_abbrev;
  char first_atom[5];
  char second_atom[5];
};

//  /*1*/ // char acidic;          // Acidic  <=>  Negative
//  /*2*/ // char acyclic;         // Acyclic <=> !Cyclic
//  /*3*/    char aliphatic;
//  /*4*/    char aromatic;
//  /*5*/ // char basic;           // Basic   <=>  Positive
//  /*6*/ // char buried;          // Buried  <=> !Surface
//  /*7*/ // char charged;         // Neutral <=> !Charged
//  /*8*/    char cyclic;
//  /*9*/ // char hydrophobic;     // Hydroph <=> !Polar
//  /*0*/    char large;
//  /*1*/    char medium;
//  /*2*/    char negative;
//  /*3*/    char neutral;
//  /*4*/    char polar;
//  /*5*/    char positive;
//  /*6*/    char small;
//  /*7*/    char surface;
//};

/**
   Get the single letter amino acid abbreviation given the three
   letter abbreviation.  Returns null ('\0') if no such abbreviation
   exists.

   @param longAbbrev A string containing the long abbreviation.  Only the first three characters will be considered.
   \ingroup AATable
*/
char aa_get_short_abbrev(const char longAbbrev[3]);
/**\ingroup AATable*/
int aa_get_table_offset(const char short_abbrev);


/**\ingroup AATable*/
double aa_type_distance(char t1, char t2);
/**\ingroup AATable*/
double aa_type_hydrophobicity(char t);

#ifndef _AA_TABLE_C
/**\ingroup AATable*/
extern const struct aa_entry aa_table [AA_COUNT];
/**\ingroup AATable*/
extern const struct aa_active_site_def aa_active_sites [AA_COUNT];
/**\ingroup AATable*/
extern const double aa_hydrophobicity [AA_COUNT];
/**\ingroup AATable*/
extern const int blosum62[24][24];
#endif


/**@}*/

#define MAX_BLOSUM_SCORE 11

#endif // __AA_TABLE_H
